﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Util{
    public static CrossVal UnCrossVal(CrossVal val)
    {
        if (val == CrossVal.nil)
            return val;
        else if (val == CrossVal.black)
            return CrossVal.white;
        else if (val == CrossVal.white)
            return CrossVal.black;
        else
            return CrossVal.out_of_range;
    }

    public static CrossVal GetMapValue(CrossVal[,] map, Point pt)
    {
        if (pt.x < 0 || pt.y < 0)
            return CrossVal.out_of_range;

        if (pt.x >= Constant.CrossCount || pt.y >= Constant.CrossCount)
            return CrossVal.out_of_range;

        return map[pt.x, pt.y];
    }
}
